package com.foreveross.fetl.core.domain.freight;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.domain.BaseEntity;
import com.foreveross.fetl.core.domain.freight.repository.ICsairTaobaoRepository;

@Entity
@Table(name="csair_taobao")
public class CsairTaobaoEntity extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2039496823738451397L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	/**
	 * 报表日期  2014-01-01
	 */
	@Column(name="REPORT_DATE")
	private Date reportDate;
	
	/**
	 * 航班日期 2014-01-01
	 */
	@Column(name="FLIGHT_DATE")
	private Date flightDate;
	
	/**
	 * 出发城市三字码
	 */
	@Column(name="FROM_CITY")
	private String fromCity;
	
	/**
	 * 出发城市名称
	 */
	@Column(name="FROM_CITY_NAME")
	private String fromCityName;
	
	/**
	 * 到达城市三字码
	 */
	@Column(name="TO_CITY")
	private String toCity;
	
	
	
	/**
	 * 到达城市名称
	 */
	@Column(name="TO_CITY_NAME")
	private String toCityName;
	
	/**
	 * 航班号
	 */
	@Column(name="FLIGHT_NO")
	private String flightNo;
	
	/**
	 * 创建时间
	 */
	@Column(name="CREATE_TIME")
	private Date createTime;
	
	
	/**
	 * 官网rowkey
	 */
	@Column(name="HBASE_KEY")
	private String hbaseKey;
	
	/**
	 * 渠道rowkey
	 */
	@Column(name="CHANNEL_KEY")
	private String channelKey;
	
	/**
	 * 官网价格
	 */
	@Column(name="PRICE")
	private Double price;
	
	/**
	 * 渠道价格
	 */
	@Column(name="CHANNEL_PRICE")
	private Double channelPrice;
	
	/**
	 * 价差金额 官网-渠道
	 */
	@Column(name="SPREAD_AMOUNT")
	private Double spreadAmount;
	
	/**
	 * 价差比=（官网-渠道）/官网
	 */
	@Column(name="SPREAD")
	private Double spread;
	
	//渠道名称
	@Column(name="CHANNEL_NAME")
	private String cnannelName;
	
	//代理名称
	@Column(name="AGENT_NAME")
	private String agentName;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getReportDate() {
		return reportDate;
	}

	public void setReportDate(Date reportDate) {
		this.reportDate = reportDate;
	}

	public Date getFlightDate() {
		return flightDate;
	}

	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	


	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getHbaseKey() {
		return hbaseKey;
	}

	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}

	public String getChannelKey() {
		return channelKey;
	}

	public void setChannelKey(String channelKey) {
		this.channelKey = channelKey;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getChannelPrice() {
		return channelPrice;
	}

	public void setChannelPrice(Double channelPrice) {
		this.channelPrice = channelPrice;
	}

	public Double getSpreadAmount() {
		return spreadAmount;
	}

	public void setSpreadAmount(Double spreadAmount) {
		this.spreadAmount = spreadAmount;
	}

	public Double getSpread() {
		return spread;
	}

	public void setSpread(Double spread) {
		this.spread = spread;
	}

	public String getCnannelName() {
		return cnannelName;
	}

	public void setCnannelName(String cnannelName) {
		this.cnannelName = cnannelName;
	}

	public String getAgentName() {
		return agentName;
	}

	public void setAgentName(String agentName) {
		this.agentName = agentName;
	} 
	
	public ICsairTaobaoRepository getICsairTaobaoRepository(){
		return InstanceFactory.getInstance(ICsairTaobaoRepository.class);
	}
	public int createReport(List<String> airCompanys,
			List<String> compareChanels, String formCity, String toCity,
			Date reportDate, Date endTime,Date flightDate) {
		return getICsairTaobaoRepository().createReport(airCompanys, compareChanels, formCity, toCity, reportDate,endTime, flightDate);
	}

}
